<?php

namespace app\common\model\Subject;

use think\Model;
// 引入软删除
use traits\model\SoftDelete;
// 课程购买订单表
class Order extends Model
{
    protected $name = "subject_order";

    protected $autoWriteTimestamp = true;
 
    protected $createTime = 'createtime';
 
    protected $updateTime = false;
    use SoftDelete;
    protected $deleteTime = 'deletetime';

     // 关联查询（根据业务需求）
     public function subject()
     {
         return $this->belongsTo('app\common\model\Subject\Subject', 'subid', 'id', [], 'LEFT')->setEagerlyType(0);
     }
     public function business()
     {
         return $this->belongsTo('app\common\model\Business\Business', 'busid', 'id', [], 'LEFT')->setEagerlyType(0);
     }
}